package demo.thread;

/**
 * 守护线程
 * @author small瑞
 */
public class ThreadTest02 {
    public static void main(String[] args) {
        TreadDaemon daemon = new TreadDaemon("暴龙战士",true);
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                for(int i = 0 ; i < 10 ; i++){
                    System.out.println(Thread.currentThread().getName()+":"+i);
                }
            }
        },"小弟");
        TreadDaemon daemon1 = new TreadDaemon("无敌战神",true);
        System.out.println("---------");
        System.out.println(daemon1.isDaemon());
        System.out.println(thread.isDaemon());
        System.out.println(daemon.isDaemon());
        daemon.start();
        daemon1.start();
        thread.start();

    }
}
